package com.qfedu.service.impl;

import com.qfedu.dao.PhoneDao;
import com.qfedu.pojo.Attr;
import com.qfedu.pojo.Brand;
import com.qfedu.pojo.Phone;
import com.qfedu.service.PhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhoneServiceImpl implements PhoneService {

    @Autowired
    private PhoneDao phoneDao;


    @Override
    public List<Phone> selectAll() {
        List<Phone> phones = phoneDao.selectAll();
        return phones;
    }

    @Override
    public List<Brand> selectAllBrand() {
        List<Brand> brands = phoneDao.selectAllBrand();
        return brands;
    }

    @Override
    public List<String> selectAttrName(String attrName) {
        List<String> strings = phoneDao.selectAttrName(attrName);
        return strings;
    }

    @Override
    public List<Phone> selectAllPhone(int bid) {
        List<Phone> phones = phoneDao.selectAllPhone(bid);
        return phones;
    }

    @Override
    public List<Attr> selectAllAttr(int phoneId, int stop) {
        List<Attr> attrs = phoneDao.selectAllAttr(phoneId, stop);
        return attrs;
    }


}
